<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>

<body>
    <div id='app'>
        {{msg}}
        =====
        <com1></com1>
        ======
        <com2></com2>

        =====
        <com3></com3>

        =====
        <com4></com4>
    </div>
    <script type='text/javascript'>
        var com = `<span>我是一个span组件</span>`
        Vue.component('com1', {
            template: com
        })


        var obj = {
            template: '<a>这是一个a标签组件</a>'
        }
        Vue.component('com2', obj)


        var com3 = {
            data(){
                return {}
            },
            template: '<i>这是一个i标签</i>'
        }

        var com4 = {
            template: '<i>这是一个i标签===4</i>'
        }

        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue'
            },
            components: {
                com3,
                com4
            }
        });
    </script>
</body>

</html>